package com.kmzx.one.project.mapper;

import com.github.pagehelper.Page;
import com.kmzx.one.project.entity.FreightTariff;
import com.kmzx.one.project.entity.UserCashback;
import com.kmzx.one.project.entity.UserOrderSubs;
import com.kmzx.one.project.entity.UserShareMini;
import com.kmzx.one.project.entity.UserShareMiniDetail;
import com.kmzx.one.project.others.dso.ProdAlertDso;
import com.kmzx.one.project.others.dto.FreightDetailInfo;
import com.kmzx.one.project.others.dto.FreightInfo;
import com.kmzx.one.project.others.dto.UserAuthInfo;
import com.kmzx.one.project.others.dto.UserProfitInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface CustomerMapper {


    List<UserAuthInfo> checkUserAuth(@Param("userId") String userId);

    UserProfitInfo selectUserProfit(@Param("userId") String userId);

    BigDecimal selectUserYetAmount(@Param("userId") String userId, @Param("old") Date old, @Param("future") Date future);

    List<UserCashback> selectUserCashback(@Param("userId") String userId);

    FreightInfo selectUserFreight(@Param("userId") String userId);

    BigDecimal sumYetMoney(@Param("userId") String userId, @Param("yet") Date yet, @Param("now") Date now);

    Page<FreightDetailInfo> selectUserFreightPager(@Param("userId") String userId);

    FreightTariff selectProductFee(@Param("productId") String productId);

    int batchInsertSubOrders(@Param("list") List<UserOrderSubs> list);

    void hiddenUserCartByIds(@Param("list") List<String> list, @Param("updateTime") Date updateTime);

    int breakSelfAndUpRelations(@Param("selfUserId")String selfUserId,@Param("upUserId")String upUserId, @Param("updateTime")Date updateTime);

    UserShareMini selectUserShareMiniCode(@Param("userId") String userId);

    int insertUserShareMini(UserShareMini userShareMini);

    int insertUserShareMiniDetail(UserShareMiniDetail userShareMiniDetail);

    List<ProdAlertDso> findProdAlertInfo(@Param("flags") Integer flags);

    // 特权用户
    List<String> findSpecificUser();

    String findExpressIcon(String expressNumber);
}
